<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="{{ asset('AdminPublic/favicon.ico') }}" >
<link rel="Shortcut Icon" href="{{ asset('AdminPublic/favicon.ico') }}" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="{{ asset('AdminPublic/static/h-ui/css/H-ui.min.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('AdminPublic/static/h-ui.admin/css/H-ui.admin.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('AdminPublic/lib/Hui-iconfont/1.0.8/iconfont.css') }}" />
<link rel="stylesheet" type="text/css" href="{{ asset('AdminPublic/static/h-ui.admin/skin/default/skin.css') }}" id="skin" />
<link rel="stylesheet" type="text/css" href="{{ asset('AdminPublic/static/h-ui.admin/css/style.css') }}" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script><![endif]-->
<!--/meta 作为公共模版分离出去-->

<link href="{{ asset('AdminPublic/lib/webuploader/0.1.5/webuploader.css') }}" rel="stylesheet" type="text/css" />
</head>
<body>


<div class="page-container">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 商品详情   <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>

<!-- 商品信息 -->
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort"  style="text-align: center;" valign="middle">
			<thead>
				<tr class="text-c">
					<!-- <th width="40"><input name="" type="checkbox" value=""></th> -->
					<th width="20">ID</th>
					<th width="40">分类</th>
					<th width="40">品牌</th>
					<th width="30">图片</th>
					<th width="50">商品名称</th>
					<th width="40">商品价格</th>
					<th width="40">销量</th>
					<th width="40">点击量</th>
					<th width="20">是否促销</th>

					@if($good->promate == '1')
					<th width="40">促销开始时间</th>
					<th width="40">促销结束时间</th>
					<th width="40">促销数量</th>
					<th width="40">促销价格</th>
					@endif
					<th width="20">状态</th>
					<!-- <th width="100">操作</th> -->
				</tr>
			</thead>
			<tbody>
				<tr class="text-c va-m">
					<!-- <td><input name="" type="checkbox" value=""></td> -->
					<td style="text-align: center; vertical-align:middle">{{ $good->id }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $type->type_name }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $brand->brand_name }}</td>
					<td style="text-align: center; vertical-align:middle">
						<img width="60px" class="product-thumb" src="http://oydt3ttm3.bkt.clouddn.com/{{ $good->goods_pic }}">
					</td>
					<td style="text-align: center; vertical-align:middle">{{ $good->goods_name }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $good->price }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $good->buy_num }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $good->click_num }}</td>
					<td class="td-status" style="text-align: center; vertical-align:middle">
						@if($good->promate == '0')
							<span class="label label-defaunt radius">
								不是
							</span>
						@else
							<span class="label label-success radius">
								是
							</span>
						@endif
					</td>
					
					@if($good->promate == '1')
						@if(!empty($res))
						<td style="text-align: center; vertical-align:middle">{{ $res->promate_num }}</td>
						<td style="text-align: center; vertical-align:middle">{{ $res->promate_price }}</td>
						<td style="text-align: center; vertical-align:middle">{{ $res->start_time }}</td>
						<td style="text-align: center; vertical-align:middle">{{ $res->end_time }}</td>
						@endif
					@endif

					<td class="td-status" style="text-align: center; vertical-align:middle">
						@if($good->status == '0')
							<span class="label label-success radius">
								在售中
							</span>	
						@elseif($good->status == '1')
							<span class="label label-defaunt radius">
								已卖完
							</span>
						@elseif($good->status == '2')
							<span class="label label-defaunt radius">
								已下架
							</span>
						@endif
					</td>
						

				</tr>
			</tbody>
			
		</table>
		
	</div>

	<!-- 商品详情 -->
	商品详情:
	
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
			<thead>
				<tr class="text-c">
					<!-- <th width="40"><input name="" type="checkbox" value=""></th> -->
					<th width="20">ID</th>
					<th width="50">添加时间</th>
					<th width="50">修改时间</th>
					<th width="40">颜色</th>
					<th width="40">尺寸</th>
					<th width="40">库存</th>
					<th width="80">操作</th>
				</tr>
			</thead>
			<tbody>
				
			@if(!empty($attrs))
			@foreach($attrs as $v)	
				<tr class="text-c va-m">
					<td style="text-align: center; vertical-align:middle">{{ $v->id }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $v->created_at }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $v->updated_at }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $v->color }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $v->size }}</td>
					<td style="text-align: center; vertical-align:middle">{{ $v->reserve }}</td>
					<td class="td-manage" style="text-align: center; vertical-align:middle">
					<!-- 查看商品详情 -->

						<a style="text-decoration:none" class="ml-5" onClick="detail_edit('编辑商品属性','{{ route('detailedit', ['id' => $v->id]) }}' ,',','1000','500')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> 

							
						<a style="text-decoration:none" class="ml-5" onClick="detail_del(this, {{ $v->id }})" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
					</td>
				</tr>
			@endforeach
			@endif
			</tbody>
				
		</table>

			
	</div>
		
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="{{ asset('AdminPublic/lib/jquery/1.9.1/jquery.min.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/lib/layer/2.4/layer.js') }}"></script>
<script type="text/javascript" src="{{ asset('AdminPublic/static/h-ui/js/H-ui.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/static/h-ui.admin/js/H-ui.admin.page.js') }}"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{{ asset('AdminPublic/lib/My97DatePicker/4.8/WdatePicker.js') }}"></script> 

<script type="text/javascript" src="{{ asset('AdminPublic/lib/jquery.validation/1.14.0/jquery.validate.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/lib/jquery.validation/1.14.0/validate-methods.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/lib/jquery.validation/1.14.0/messages_zh.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/lib/webuploader/0.1.5/webuploader.min.js') }}"></script> 
<script type="text/javascript" src="{{ asset('AdminPublic/lib/ueditor/1.4.3/ueditor.config.js') }}"></script>
<script type="text/javascript" src="{{ asset('AdminPublic/lib/ueditor/1.4.3/ueditor.all.min.js') }}"> </script>
<script type="text/javascript" src="{{ asset('AdminPublic/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js') }}"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	})});


/*编辑商品属性*/
function detail_edit(title,url,id,w,h){
	layer_show(title,url,w,h);
}


/*删除*/
function detail_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type:'get',
			url:'{{route("deldetail")}}',
			data: 'id='+id,
			
			success:function (msg) {

				//删除失败
				if (msg.status == 404) {
					layer.msg(msg.msg, {icon:1,time:1000});
					return false;
				}	

				//删除成功
				if (msg.status == 200) {
					layer.msg(msg.msg, {icon:1,time:1000});
					return false;
				}
			},
			// error:function (e,a,b) {
			// 	errorObj = JSON.parse(e.responseText);
			// 	console.log(errorObj);
			// },
			dataType:'json'
		});
		// $(obj).parents("tr").remove();
		// layer.msg('已删除!',{icon:1,time:1000});
	});
}


</script>
